/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cadastroalunos;

import java.awt.event.KeyEvent;

/**
 *
 * @author Rafael
 */
public class Catis extends javax.swing.JFrame {

    /**
     * Creates new form Catis
     */
    public Catis() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        btn_CadastrarCatis = new javax.swing.JButton();
        btn_AtualizarCatis = new javax.swing.JButton();
        btn_ExcluirCatis = new javax.swing.JButton();
        btn_Voltar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Catis");

        btn_CadastrarCatis.setText("Cadastrar Catis");
        btn_CadastrarCatis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_CadastrarCatisActionPerformed(evt);
            }
        });
        btn_CadastrarCatis.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btn_CadastrarCatisKeyPressed(evt);
            }
        });

        btn_AtualizarCatis.setText("Atualizar Catis");
        btn_AtualizarCatis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_AtualizarCatisActionPerformed(evt);
            }
        });
        btn_AtualizarCatis.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btn_AtualizarCatisKeyPressed(evt);
            }
        });

        btn_ExcluirCatis.setText("Excluir Catis");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btn_CadastrarCatis)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)
                .addComponent(btn_AtualizarCatis)
                .addGap(18, 18, 18)
                .addComponent(btn_ExcluirCatis)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_ExcluirCatis)
                    .addComponent(btn_AtualizarCatis)
                    .addComponent(btn_CadastrarCatis))
                .addContainerGap(37, Short.MAX_VALUE))
        );

        btn_Voltar.setText("Voltar");
        btn_Voltar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_VoltarActionPerformed(evt);
            }
        });
        btn_Voltar.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                btn_VoltarKeyPressed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btn_Voltar)
                .addContainerGap())
            .addGroup(layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(24, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(39, 39, 39)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 127, Short.MAX_VALUE)
                .addComponent(btn_Voltar)
                .addContainerGap())
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-416)/2, (screenSize.height-338)/2, 416, 338);
    }// </editor-fold>//GEN-END:initComponents

    private void btn_AtualizarCatisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_AtualizarCatisActionPerformed
    new AtualizarCatis().setVisible(true);
    this.dispose();
    }//GEN-LAST:event_btn_AtualizarCatisActionPerformed

    private void btn_VoltarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_VoltarActionPerformed
      new Principal().setVisible(true);
      this.dispose();
    }//GEN-LAST:event_btn_VoltarActionPerformed

    private void btn_VoltarKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btn_VoltarKeyPressed
     if(evt.getKeyCode()==KeyEvent.VK_ENTER){
     btn_VoltarActionPerformed(null);
     }
    }//GEN-LAST:event_btn_VoltarKeyPressed

    private void btn_CadastrarCatisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_CadastrarCatisActionPerformed
new CadastrarCatis().setVisible(true);
this.dispose();
    }//GEN-LAST:event_btn_CadastrarCatisActionPerformed

    private void btn_CadastrarCatisKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btn_CadastrarCatisKeyPressed
if(evt.getKeyCode()==KeyEvent.VK_ENTER){
btn_CadastrarCatisActionPerformed(null);
}
    }//GEN-LAST:event_btn_CadastrarCatisKeyPressed

    private void btn_AtualizarCatisKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_btn_AtualizarCatisKeyPressed
       if(evt.getKeyCode()==KeyEvent.VK_ENTER){
btn_AtualizarCatisActionPerformed(null);
}
    }//GEN-LAST:event_btn_AtualizarCatisKeyPressed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Catis.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Catis.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Catis.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Catis.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Catis().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_AtualizarCatis;
    private javax.swing.JButton btn_CadastrarCatis;
    private javax.swing.JButton btn_ExcluirCatis;
    private javax.swing.JButton btn_Voltar;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables
}
